Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amp-auto-ads: Ad placement configuration errors are user errors #9001

Merged
merged 2 commits into from
Apr 28, 2017

Conversation

jridgewell
Copy link
Contributor

@jridgewell jridgewell commented Apr 27, 2017

This moves all configuration errors into the user logs. The configurations aren't the AMP developers' responsibility, they're the ad server's.

This also cancels the entire promise queue if fetching/parsing of the configuration fails. There's no point in running any of the other code if it does.

Fixes #8997.
Fixes #8998.
Fixes #9023.

/to @tlong2

@jridgewell jridgewell requested a review from muxin April 27, 2017 18:28
dev().error(TAG, 'amp-auto-ads config xhr failed: ' + reason);
return null;
user().error(TAG, 'amp-auto-ads config xhr failed: ' + reason);
throw reason;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we keep the return null?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This also cancels the entire promise queue if fetching/parsing of the configuration fails.

This is specifically to stop further processing, since we can't do anything without a config.

@jridgewell jridgewell merged commit 7555ae2 into ampproject:master Apr 28, 2017
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
…roject#9001)

* Ad placement configuration errors are user errors

* Fix type checks
KenneyE pushed a commit to spotxchange/amphtml that referenced this pull request May 3, 2017
…roject#9001)

* Ad placement configuration errors are user errors

* Fix type checks
@jridgewell jridgewell deleted the amp-auto-ads-errors branch September 15, 2017 17:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants